﻿using NUnit.Framework;
using Sasa.QualityTools.CodeAnalysis.FxCopIntegrator.Searching;
using Sasa.QualityTools.CodeAnalysis.FxCopIntegrator.ViewModels;
using System;

namespace Sasa.QualityTools.CodeAnalysis.FxCopIntegrator.Tests.Unit.Searching
{
    [TestFixture]
    public class KindSearcherGeneratorTest
    {
        private KindSearcherGenerator testee;


        public TestContext TestContext { get; set; }


        [SetUp]
        public void SetUp()
        {
            this.testee = new KindSearcherGenerator();
        }

        [Test]
        public void TestGenerate()
        {
            var searcher = this.testee.Generate("class");
            Assert.IsTrue(searcher(new ProblemViewModel { Kind = "Class" }));
            Assert.IsFalse(searcher(new ProblemViewModel { Kind = "Constructor" }));
            Assert.IsFalse(searcher(new ProblemViewModel { Kind = "Delegate" }));
            Assert.IsFalse(searcher(new ProblemViewModel { Kind = "Enum" }));
            Assert.IsFalse(searcher(new ProblemViewModel { Kind = "Event" }));
            Assert.IsFalse(searcher(new ProblemViewModel { Kind = "Field" }));
            Assert.IsFalse(searcher(new ProblemViewModel { Kind = "Interface" }));
            Assert.IsFalse(searcher(new ProblemViewModel { Kind = "Method" }));
            Assert.IsFalse(searcher(new ProblemViewModel { Kind = "Module" }));
            Assert.IsFalse(searcher(new ProblemViewModel { Kind = "Namespace" }));
            Assert.IsFalse(searcher(new ProblemViewModel { Kind = "Property" }));
            Assert.IsFalse(searcher(new ProblemViewModel { Kind = "Resource" }));
            Assert.IsFalse(searcher(new ProblemViewModel { Kind = "Struct" }));
            Assert.IsFalse(searcher(new ProblemViewModel { Kind = "Target" }));
        }
    }
}
